﻿#ifndef __SS_CLOCKWHEEL_THREAD_H__
#define __SS_CLOCKWHEEL_THREAD_H__
#include "./ssClockWheel.h"
#include "../../thread/ssThreadBase.h"
#include "../../thread/threadLock/ssThreadLock.h"

namespace StarSeeker
{

class ssClockWheelThread : protected ssClockWheel, public ssThreadBase
{
	union Tick_u
	{
		u32	tick;
		struct { u8 _l1, _l2, _l3, _l4; };
	};
public:
	ssClockWheelThread();
	~ssClockWheelThread();
	//启动半点计时器
	void StartHalfHourTimer();
	//添加计时器
	u32 AddNewTimer(u32 msgType, u64 timestamp, u32 interval, ulint p1, ulint p2);
	u32 AddNewTimer(u32 msgType, u32 interval, ulint param1, ulint param2);
	//删除计时器
	void DeleteTimer(u32 timerId);
	//停止线程
	void ExitThread();
private:
	virtual void ThreadMemberFunc();
private:
	ssThreadLock		m_mutex;		//互斥量
};

}
#endif
